import os
from python_ai.common.xcommon import *
import numpy as np

BASE_DIR, FILE_NAME = os.path.split(__file__)
dir = '../../../../large_data/BN values'
DATA_DIR = os.path.join(BASE_DIR, dir)

for filename in os.listdir(DATA_DIR):
    _, ext = os.path.splitext(filename)
    ext = ext.lower()
    if ext != '.txt':
        continue
    sep(filename)
    filepath = os.path.join(DATA_DIR, filename)
    with open(filepath, 'r') as f:
        lines = f.readlines()
    layer = 0
    for line in lines:
        layer += 1
        line = line.strip()
        arr = np.float32([float(element) for element in line.split(' ')])
        print(layer, len(arr), arr.mean(), arr.std())
